package com.vaadin.thomas.contenttool;

import java.util.Locale;
import java.util.Set;
import java.util.logging.Logger;

import com.vaadin.thomas.contenttool.data.Tag;
import com.vaadin.thomas.contenttool.exceptions.ValueNotFoundException;

public interface Config {

	/**
	 * @return All languages that are allowed when using this tool.
	 */
	Set<Locale> getAllowedLanguages();

	/**
	 * @return if {@link Tag}s allowed and visible in the UI.
	 */
	boolean allowTags();

	/**
	 * @return if timed publishing should be enabled.
	 */
	boolean allowTimedPublishing();

	/**
	 * @return the URL of the actual application; used when linking preview
	 *         modes from admin UI.
	 */
	String appURL();

	/**
	 * @return directory where to store the data.
	 */
	String storageLocation();

	/**
	 * @return debug mode on or off; when in debug, more information is printed
	 *         to SysOut.
	 */
	boolean debug();

	/**
	 * @return the logger to use; if null, messages are are printed to SysOut
	 *         and SysErr
	 */
	Logger logger();

	/**
	 * @param id
	 * @return formatted user name for the user with the given id; id is taken
	 *         from {@link #getUserIdToStore()}
	 */
	String getUserNameForAdminUI(String id);

	/**
	 * 
	 * @return user id to store as committer in the data store.
	 */
	String getUserIdToStore();

	/**
	 * @return should Content Tool UI identifiers be visible in the Tool.
	 */
	boolean showContentToolIdentifiers();

	/**
	 * @return if a {@link ValueNotFoundException} should be thrown when a value
	 *         is not found with {@link ContentTool#get(String)}.
	 */
	boolean throwWhenValueNotFound();

	/**
	 * @return if an empty data store should be created if the required
	 *         prerequisites are not present already. Initialization will fail
	 *         if prerequisites can't be found.
	 */
	boolean autoCreateDataStoreIfNotFound();

}
